
//模块主窗口
JieSuanDataPanel = Ext.extend(Ext.Panel,{
	 closable: true,
   	 autoScroll:true,
   	 width:'100%',
   	 initComponent : function() {
   			this.tbar =  this.buildBbar() ;
   			var gd = new JieSuanGridPanel() ;
   			this.items = [new QueryStatJieSuanUserForm({
                                	thisGrid:gd
                                }),gd] ;
			this.formPanel =  new Ext.Window({
	   			layout:"fit",
	   			title: "按条件查询结算用户信息",
	   			closeAction: 'hide',
                                resizable:false,
                                modal:true,
                                width:550,
                                height:350,
                                items :[new QuerySettleUserForm({
                                	thisGrid:gd
                                })]
   			});
   			
   		JieSuanDataPanel.superclass.initComponent.call(this);
   	},
   	queryHighFeeUser : function(btn) {
   		 var tform = btn.ownerCt.ownerCt.formPanel;
   	     tform.show();
   	}
   ,	buildBbar: function() {
   		return [
   		{
                                   text : "显示查询",
   				                   iconCls: 'ico-dot-search-open',
                                   handler:function(btn){
                                   	var m = btn.ownerCt.ownerCt;
                                   	var g = m.items.get(1);
                                   	var a = m.items.get(0);
                                   	a.setHeight(70);
                                   	a.searchBtn = btn;
                                   	if(a.collapsed) {
                                   		var h1 = m.getHeight()-m.tbar.dom.clientHeight-a.getHeight();
                                   		a.expand(true);
                                   		g.setHeight(h1-70);
                                   		btn.setText("隐藏查询");
				   						btn.setIconClass("ico-dot-search-hidden");
				   					} else {
				   						a.collapse(true);
				   						g.setHeight(m.getHeight()-m.tbar.dom.clientHeight-1);
				   						btn.setText("显示查询");
				   						btn.setIconClass("ico-dot-search-open");
                                   	}
                                   }
   			},'-',{
   				text : "问题处理",
   				handler :this.updateSettletData,
   				iconCls: 'ico-dot-edit-news'
   			}
//   			{
//                                   text : "按条件查询",
//                                   handler :this.queryHighFeeUser,
//                                   iconCls: 'ico-dot-search'
//   			}
   			,'-',{
                                   text : "数据导出",
                                   handler :this.exportData,
                                   iconCls: 'ico-dot-report'
   			}
   			
//   			,'-',{
//                                   text : "原因标注",
//                                   handler:this.readInfo,
//                                   //iconCls: 'ico-dot-question'
//   			}
   			,'->',{
                    	text:'操作说明'					
                    	,iconCls:'ico-dot-question'
                    	,handler:function(){
                    		SM.Explanation.showExplanation(36);
                    	}
                    }
   			] ;
   	}
   	,updateSettletData : function(btn) {
   		 var mPanel = btn.ownerCt.ownerCt;
   		 var gp = mPanel.items.get(1) ;
   		 var rows= gp.getSelectionModel().getSelections(); 
   		 if(rows.length==0) {
 			MsgTip.msg({
			 	msg:"请选择一条记录"
			 	,cmp: mPanel
			 	,pos:"top"
			 	,time:2
			});
   			 return ;
   		 }
   		 if(!mPanel.updatePanel) {
   			mPanel.updatePanel = new Ext.Window({
	   			layout:"fit",
	   			title: "处理问题",
	   			closeAction: 'hide',
				resizable:false,
				modal:true,
				width:400,
				height:200,
				items :[{
					xtype:'form'
					,layout:'form'
					,border:false
					,labelAlign:"left"
					,frame:true
					,items:[{
						fieldLabel:'处理描述'
						,xtype:'textarea'
						,labelWidth:65
						,name:'settleUser.dealText'
						,height:100
						,anchor:'95%'
					}]
					,minButtonWidth:50
			   		,buttonAlign:'center'
				   	,buttons:[{
				   		text:'提交'
				   		,handler:function(btn) {
				   			var form = btn.ownerCt.ownerCt.getForm();
				   				mPanel.execInfo(mPanel,form);
				   			} 
				   		}]
				}]
				
   			});
   		}
   	    mPanel.updatePanel.show();
   	},	execInfo: function(m,form) {
   		var gp = m.items.get(1) ; 	
   		var rows= gp.getSelectionModel().getSelections(); 
   		var ids = "";
   		var errFlags = m.monitorType;
   			
   		for(var i=0 ;i<rows.length;i++) {
   			if(i==0) {
   				ids = rows[i].data['SEQID'] ;
   			}else{
   				ids = ids +","+rows[i].data['SEQID'] ;
   			}
   		}
   		form.submit( {	
				waitTitle : '请稍候...',
				waitMsg : '正在提交表单数据,请稍候...',
				method : 'post',
				params : {
					ids:ids
				},
				
				url : 'Settle_updateFlag.action',
				scope : this,
				success : function(form, action) {
					var Result=action.result;
					if(Result.success) {
						gp.getStore().reload();
						m.updatePanel.hide() ;
						MsgTip.msg({
						 	msg:"处理成功~~"
						 	,cmp: m
						 	,pos:"top"
						 	,time:2
						});
					} else {
						m.updatePanel.hide() ;
						MsgTip.msg({
						 	msg:"处理异常,请重试~"
						 	,cmp: m
						 	,pos:"top"
						 	,time:2
						});
					}
				},
				failure : function() {
						m.updatePanel.hide() ;
						MsgTip.msg({
						 	msg:"网络异常,请重试~"
						 	,cmp: m
						 	,pos:"top"
						 	,time:2
						});
					}
				});
   	},readInfo : function(){
   		new Ext.Window({
   			layout:"border",
   			title: "原因标注",
   			closeAction: 'close',
			resizable:false,
			modal:true,
			width:400,
			height:350,
			items :[new ReadInfoForm({})]
   		}).show();
   	},
   	exportData:function(btn) {
   		var gp = btn.ownerCt.ownerCt.items.get(1) ;
   			var baseParams = gp.getStore().baseParams;
   		var ul = Ext.urlEncode(baseParams);
   		var st = gp.getStore();
   		Ext.MessageBox.confirm("确认", "确定导出?", function(btn) {
		if (btn == "yes") {

			window.location.href ="Settle_exportTfFSettleUserToExcel.action?limit="+st.totalLength;
		}
		});
   		
   	} 
});


//原形标注
ProtoTypeForm = Ext.extend(Ext.form.FormPanel,{
	text:"表单",
	layout:"form",
	region : "center",
	labelAlign:"left",
	width:400,
	height:350,
	frame:true,
	initComponent: function(){
	this.items=[{fieldLabel : '问题类型',
                                			name : 'biz_type',
                                			xtype : 'combo',
                                			editable : false,
                                			mode : 'local',
                                			emptyText:"请选择",
                                			triggerAction : 'all',
                                			store : [['0','低级'],['1','低级'],['2','高级']],
                                			anchor:"90%"
                                		},{fieldLabel : '&nbsp;&nbsp;原因分析&nbsp;&nbsp;',
	                value : '原因分析',
                                	xtype : 'textarea',
                                	anchor:"97%"
                                }
                                /*,{fieldLabel : '&nbsp;&nbsp;警告告警&nbsp;&nbsp;<img src="images/076.png"/>&nbsp;&nbsp;',
                                	value : '阀值为 500 元                                               不影响现有业务，但需进行检查核对以阻止恶化的告警。',
                                	xtype : 'textarea',
                                	anchor:"97%"
                                }*/
		];
	  ProtoTypeForm.superclass.initComponent.call(this);
	},
	buttonAlign :'center',
	minButtonWidth:60,
	buttons:[{
		text : '关闭',
		handler : function() {this.ownerCt.ownerCt.ownerCt.hide();}
	}]
});


//按条件查询高额用户
QuerySettleUserForm = Ext.extend(Ext.form.FormPanel,{
	text:"表单",
	layout:"form",
	region : "center",
	labelAlign:"right",
	width:550,
	height:300,
	frame:true,
	initComponent: function(){
	var cityNameSelect = new Ext.data.JsonStore({
	    url: "highFee_getCityCode.action?type=1",//第一个comboBox的json数据的URL地址
	    root: "root",
	    fields: ["paramValue", "displayValue"]
	});
	this.items=[							{fieldLabel : '账&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;期',
                                			name : 'cycleId',
                                			xtype : 'combo',
                                			editable : false,
                                			mode : 'local',
                                			triggerAction : 'all',
                                			store : getCyids(),//  [['0','请选择'],['201303','201303'],['201304','201304'],['201305','201305']],
                                			anchor:"90%",
                                			emptyText:"请选择",
                                			width:60
                                	    	}
											,{fieldLabel : '归属地市',
                                			name : 'eparchyCode',
                                			xtype : 'combo',
                                			editable : false,
                                			mode : 'remote',
                                			triggerAction : 'all',
                                			valueField: "paramValue",
                                   			displayField: "displayValue",
                                			store : areaCodeSelect,
                                			emptyText:"请选择",
                                			anchor:"90%",
                                			width:60,
                                			listeners : {
		                                 		"select": function(combo){
                                                                	combo.ownerCt.getForm().findField("cityCode").reset();
                                                                	cityNameSelect.baseParams={'areaCode':combo.getValue()};
                                                                	cityNameSelect.load();
		                                 		}
                                			}
                                		},{fieldLabel : '归属区县',
                                			name : 'cityCode',
                                			xtype : 'combo',
                                			editable : false,
                                			mode : 'remote',
                                			triggerAction : 'all',
                                			valueField: "paramValue",
                                   			displayField: "displayValue",
                                			store : cityNameSelect,
                                			emptyText:"请选择",
                                			anchor:"90%",
                                			width:70
                                		}
                                		,{fieldLabel : '网别',
                                			name : 'nettypecode',
                                			xtype : 'combo',
                                			editable : false,
                                			mode : 'local',
                                			emptyText:"请选择",
                                			triggerAction : 'all',
                                			store : [['10','2G'],['33','3G']],
                                			anchor:"90%",
                                			width:100
                                		}
//                                		,{fieldLabel : '营收类型',
//                                			name : 'biz_type',
//                                			xtype : 'combo',
//                                			editable : false,
//                                			mode : 'local',
//                                			emptyText:"请选择",
//                                			triggerAction : 'all',
//                                			store : [['0','结算小于营收'],['1','结算大于营收']],
//                                			anchor:"90%"
//                                		}
                                		,{fieldLabel : '用户号码',
                                			name : 'msisdn',
                                			xtype : 'textfield',
                                			anchor:"90%",
                                			width:100
                                		}
		];
	  QuerySettleUserForm.superclass.initComponent.call(this);
	},
	buttonAlign :'center',
	minButtonWidth:60,
	buttons:[{
		text:"确定",
		handler : function(btn){
		    var thisForm = btn.ownerCt.ownerCt.getForm();
		    
//		    var statDay = thisForm.findField('statDay').getValue();	 
//		    	statDay = statDay?statDay.format("Ymd"):"";	    
//		    var net_type_code = thisForm.findField('net_type_code').getValue();
//		    var biz_type = thisForm.findField('biz_type').getValue();
//		    var curstatus = thisForm.findField('curstatus').getValue();
//		    var user_id = thisForm.findField('user_id').getValue();
		    var cityCode = thisForm.findField('cityCode').getValue();
			var nettypecode = thisForm.findField('nettypecode').getValue();
			var eparchyCode  = thisForm.findField('eparchyCode').getValue();
			var cycleId = thisForm.findField('cycleId').getValue();
			var msisdn  = thisForm.findField('msisdn').getValue();
		    var store = btn.ownerCt.ownerCt.thisGrid.getStore();
		    btn.ownerCt.ownerCt.thisGrid.recordStart = 1;
		    store.baseParams = {
		    			'settleUser.cityCode':cityCode,
		    			'settleUser.eparchyCode':eparchyCode,
                                		'settleUser.netTypeCode':nettypecode,
		    			'settleUser.cycleId':cycleId,
		    			'settleUser.serialNumber':msisdn

			};

            store.load({params:{start:0, limit:200}});
		    
		   this.ownerCt.ownerCt.ownerCt.hide();//隐藏弹出页面
		}
	}, {
		text : '重置',
		handler : function() {this.ownerCt.ownerCt.form.reset();}
	}, {
		text : '取消',
		handler : function() {this.ownerCt.ownerCt.ownerCt.hide();}
	}]
});


//结算用户信息列表
JieSuanGridPanel = Ext.extend(Ext.grid.GridPanel,{
	title : '结算用户信息列表',
	header: false,
	frame:true,
	loadMask:{msg:'加载中...'},
	enableDragDrop: false,
	height: 560,
	columnLines:true,
	allowHeaderWrap:true,
	allowWrap:false,
//	viewConfig :{
//        forceFit: true
//    },
	initComponent : function() {
       	var thisGrid = this;
       	this.recordStart = 1 ;
    	var highFeeUserCm = new Ext.grid.CheckboxSelectionModel({
                                dataIndex: "uid",
                sortable: false,
                singleSelect:false,
                width:20
		});
		var highFeeUserNew = new　Ext.grid.RowNumberer({
		　　header　:　"序号",
		　　width　:　35　
		});
		this.columns　=[highFeeUserCm,highFeeUserNew,
		{
		        				header:'账期',
                                sortable:true,
                                dataIndex:"CYCLEID",
                                width:60
                              	,headerAlign :"center"
								,align :"left"
								,allowHeaderWrap:true
								,allowWrap:false
			},{
                                header:'归属地市',
                                sortable:true,
                                dataIndex:"EPARCHYCODE",
                                width:60
                               	,headerAlign :"center"
								,align :"left"
								,allowHeaderWrap:true
								,allowWrap:false
			},{
                                header:'归属区县',
                                sortable:true,
                                dataIndex:"CITYCODE",
                                width:70
                                ,headerAlign :"center"
								,align :"left"
								,allowHeaderWrap:true
								,allowWrap:false
			},{
		        				header:'网别',
                                sortable:true,
                                dataIndex:"NETTYPECODE",
                                width:100
                                ,headerAlign :"center"
								,align :"left"
								,allowHeaderWrap:true
								,allowWrap:false
			},{
		        				header:'用户号码',
                                sortable:true,
                                dataIndex:"SERIALNUMBER",
                                width:100
                                ,headerAlign :"center"
								,align :"left"
								,allowHeaderWrap:true
								,allowWrap:false
			},{
		      					header:'用户编码',
                                sortable:true,
                                hidden:true,
                                dataIndex:"USERID",
                                width:100
                                ,headerAlign :"center"
								,align :"center"
								,allowHeaderWrap:true
								,allowWrap:false
			}
			,{
		        				header:'客户名称',
                                sortable:true,
                                dataIndex:"CUSTNAME",
                                width:100
                                ,headerAlign :"center"
								,align :"center"
								,allowHeaderWrap:true
								,allowWrap:false
			   					,cellTip:true
			},{
		        				header:'客户类型',
                                sortable:true,
                                hidden:true,
                                dataIndex:"CUSTTYPE",
                                width:100
                                ,headerAlign :"center"
								,align :"center"
								,allowHeaderWrap:true
								,allowWrap:false
			}
//			,{
//                                header:'省内主叫国内长途时长(套餐内)',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"CALLTIMELINTER",
//                                width:70
//			},{
//                                header:'省内主叫国内长途(套餐内)二批费用',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"FEELINTER",
//                                width:70,
//                                renderer:this.ToFixed
//			},{
//                                header:'省内主叫国内长途(套餐内)结算费用',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"FEEJSLINTER",
//                                width:70,
//                                renderer:this.ToFixed
//			},{
//                                header:'省内主叫国内长途时长(套餐外)',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"CALLTIMELOUTER",
//                                width:70
//			},{
//                                header:'省内主叫国内长途(套餐外)二批费用',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"FEELOUTER",
//                                width:70,
//                                renderer:this.ToFixed
//			},{
//                                header:'省内主叫国内长途(套餐外)结算费用',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"FEEJSLOUTER",
//                                width:70,
//                                renderer:this.ToFixed
//			},{
//                                header:'省际漫游主叫国内长途时长(套餐内)',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"CALLTIMERLINTER",
//                                width:70
//			},{
//                                header:'省际漫游主叫国内长途(套餐内)二批费用',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"FEERLINTER",
//                                width:70,
//                                renderer:this.ToFixed
//			},{
//                                header:'省际漫游主叫国内长途(套餐内)结算费用',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"FEEJSRLINTER",
//                                width:70,
//                                align :"right",
//                                renderer:this.ToFixed
//			},{
//                                header:'省际漫游主叫国内长途时长(套餐外)',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"CALLTIMERLOUTER",
//                                width:70
//			},{
//                                header:'省际漫游主叫国内长途(套餐外)二批费用',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"FEERLOUTER",
//                                width:70,
//                                renderer:this.ToFixed
//			},{
//                                header:'省际漫游主叫国内长途(套餐外)结算费用',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"FEEJSRLOUTER",
//                                width:70,
//                                renderer:this.ToFixed
//			},{
//                                header:'省际漫游主叫省内时长(套餐内)',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"CALLTIMERINTER",
//                                width:70
//			},{
//                                header:'省际漫游主叫国内长途(套餐外)结算费用',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"FEEJSRLOUTER",
//                                width:70,
//                                renderer:this.ToFixed
//			},{
//                                header:'省际漫游主叫省内(套餐内)二批费用',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"FEERINTER",
//                                width:70,
//                                renderer:this.ToFixed
//			},{
//                                header:'省际漫游主叫省内(套餐内)结算费用',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"FEEJSRINTER",
//                                width:70,
//                                renderer:this.ToFixed
//			},{
//                                header:'省际漫游主叫省内时长(套餐外)',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"CALLTIMEROUTER",
//                                width:70
//			},{
//                                header:'省际漫游主叫省内时长(套餐外)二批费用',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"FEEROUTER",
//                                width:70,
//                                renderer:this.ToFixed
//			},{
//                                header:'省际漫游主叫省内(套餐外)结算费用',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"FEEJSROUTER",
//                                width:70,
//                                renderer:this.ToFixed
//			},{
//                                header:'省际漫游被叫时长(套餐内)',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"CALLTIMEBJRINTER",
//                                width:70
//			},{
//                                header:'省际漫游被叫(套餐内)二批费用',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"FEEBJRINTER",
//                                width:70,
//                                renderer:this.ToFixed
//			},{
//                                header:'省际漫游被叫(套餐内)结算费用',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"FEEJSBJRINTER",
//                                width:70,
//                                renderer:this.ToFixed
//			},{
//                                header:'省际漫游被叫时长(套餐外)',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"CALLTIMEBJROUTER",
//                                width:70
//			},{
//                                header:'省际漫游被叫(套餐外)二批费用',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"FEEBJROUTER",
//                                width:70,
//                                renderer:this.ToFixed
//			},　
//		    {
//                                header:'省际漫游被叫(套餐外)结算费用',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"FEEJSBJROUTER",
//                                width:70,
//                                renderer:this.ToFixed
//			},　
//		    {
//                                header:'漫游流量(标批为0)',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"CHARGEDUNITS0",
//                                width:70
//			},　
//		    {
//                                header:'漫游流量(标批为0)结算费用',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"FEEJSGS0",
//                                width:70,
//                                renderer:this.ToFixed
//			},　
//		    {
//                                header:'漫游流量(套餐内)',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"CHARGEDUNITSINTER",
//                                width:70
//			},　
//		    {
//                                header:'漫游流量(套餐内)结算费用',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"FEEJSGSINTER",
//                                width:70,
//                                renderer:this.ToFixed
//			},　
//		    {
//                                header:'漫游流量(套餐外)',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"CHARGEDUNITSOUTER",
//                                width:70
//			},　
//		    {
//                                header:'漫游流量(套餐外)二批费用',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"FEEGSOUTER",
//                                width:70,
//                                renderer:this.ToFixed
//			},　
//		    {
//                                header:'漫游流量(套餐外)结算费用',
//                                sortable:true,
//                                hidden:true,
//                                dataIndex:"FEEJSGSOUTER",
//                                width:70,
//                                renderer:this.ToFixed
//			}
			,{
                                header:'二批总费用(元)',
                                sortable:true,
                                hidden:true,
                                dataIndex:"FEE",
                                width:100
                               	,headerAlign :"center"
								,align :"right"
								,allowHeaderWrap:true
								,allowWrap:false
			}			　
		    ,{
                                header:'优惠费用(元)',
                                sortable:true,
                                hidden:true,
                                dataIndex:"FEEDISCNTFEE",
                                width:100
                               	,headerAlign :"center"
								,align :"right"
								,allowHeaderWrap:true
								,allowWrap:false
			},　
		    {
                                header:'账前调账费用(元)',
                                sortable:true,
                                hidden:true,
                                dataIndex:"FEEADJUSTBEFORE",
                                width:100
                               	,headerAlign :"center"
								,align :"right"
								,allowHeaderWrap:true
								,allowWrap:false
			},　
		    {
                                header:'账后调账费用(元)',
                                sortable:true,
                                hidden:true,
                                dataIndex:"FEEADJUSTAFTER",
                                width:100
                               	,headerAlign :"center"
								,align :"right"
								,allowHeaderWrap:true
								,allowWrap:false
			},　
 			{
                                header:'省内主叫国内长途时长(秒)',
                                sortable:true,	
                                dataIndex:"CALLTIMEL",
                                width:100
                               	,headerAlign :"center"
								,align :"right"
								,allowHeaderWrap:true
								,allowWrap:false
			},　
		    {
                                header:'省内主叫国内长途结算费用(元)',
                                sortable:true,
                                dataIndex:"FEEJSL",
                                width:100
                               	,headerAlign :"center"
								,align :"right"
								,allowHeaderWrap:true
								,allowWrap:false

			},　
		    {
                                header:'省际漫游主被叫时长(秒)',
                                sortable:true,
                                dataIndex:"CALLTIMER",
                                width:100
                               	,headerAlign :"center"
								,align :"right"
								,allowHeaderWrap:true
								,allowWrap:false

			},　
		    {
                                header:'省际漫游主被叫结算费用(元)',
                                sortable:true,
                                dataIndex:"FEEJSR",
                                width:100
                               	,headerAlign :"center"
								,align :"right"
								,allowHeaderWrap:true
								,allowWrap:false

			},　
		    {
                                header:'国内漫游流量(KB)',
                                sortable:true,
                                dataIndex:"CHARGEDUNITS",
                                width:100
                               	,headerAlign :"center"
								,align :"right"
								,allowHeaderWrap:true
								,allowWrap:false

			},　
		    {
                                header:'国内漫游流量结算费用(元)',
                                sortable:true,
                                dataIndex:"FEEJSGS",
                                width:100
                               	,headerAlign :"center"
								,align :"right"
								,allowHeaderWrap:true
								,allowWrap:false

			}
			,{
                                header:'结算费用(元)',
                                sortable:true,                                			
                                dataIndex:"FEEJS",
                                width:100
                               	,headerAlign :"center"
								,align :"right"
								,allowHeaderWrap:true
								,allowWrap:false

			}
		    ,{
                                header:'账单费用(元)',
                                sortable:true,
//                                hidden:true,
                                dataIndex:"FEEBILL",
                                width:100
                               	,headerAlign :"center"
								,align :"right"
								,allowHeaderWrap:true
								,allowWrap:false

			}
		    ,{
                                header:'结算净流失(元)',
                                sortable:true,
                                dataIndex:"FEELOST",
                                width:100
                                ,headerAlign :"center"
								,align :"right"
								,allowHeaderWrap:true
								,allowWrap:false

			}
//			,　
//		    {
//                                header:'营收类型',
//                                sortable:true,
//                                
//                                dataIndex:"IFERROR",
//                                renderer:function(v) {
//                                	if(v=="0") {
//                                	return "结算小于营收";
//                                	}if(v=="1"){
//                                	return "结算大于营收";
//                                	}
//                                },width:70
//                                ,align :"right"
//			}
//			,{
//                                header:'原因描述',
//                                sortable:true,                                			
//                                dataIndex:"REMARK",
//                                width:100
//                                ,align :"right"
//                                
//			}	
			,{
				header:'是否处理',
				sortable:true,
				headerAlign:"center",
				dataIndex:"dealFlag",
				renderer:function(v) {
					return v==1?"已处理":"未处理";
				}
			},{
				header:'处理描述',
				sortable:true,
				headerAlign:"center",
				dataIndex:"dealText",
				cellTip:true,
				renderer:function(value, metaData, record, rowIndex, colIndex, store) {
	   			metaData.attr = ' ext:qtip="' + value + '"';
	   			return value ;
	   		}
			}		
		] ;
	
		var dataStore = new Ext.data.JsonStore({
			operate:this,
			url : 'Settle_TfFSettleUser.action',
			root: 'root',
	        totalProperty: 'totalProperty',
	        idProperty:'seqId',
	        fields: [
                                'SEQID','CYCLEID','STATNO','DBNO','EPARCHYCODE','CITYCODE','RATEPATH','USERID','SERIALNUMBER',
                                'NETTYPECODE','BRANDCODE','PRODUCTID','PRODUCTNAME','CUSTID','CUSTTYPE','CUSTNAME','CALLTIMELINTER',
                                'FEELINTER','FEEJSLINTER','CALLTIMELOUTER','FEELOUTER','FEEJSLOUTER','CALLTIMERLINTER','FEERLINTER',
                                'FEEJSRLINTER','CALLTIMERLOUTER','FEERLOUTER','FEEJSRLOUTER','CALLTIMERINTER','FEERINTER','FEEJSRINTER',
                                'CALLTIMEROUTER','FEEROUTER','FEEJSROUTER','CALLTIMEBJRINTER','FEEBJRINTER','FEEJSBJRINTER','CALLTIMEBJROUTER',
                                'FEEBJROUTER','FEEJSBJROUTER','CHARGEDUNITS0','FEEJSGS0','CHARGEDUNITSINTER','FEEJSGSINTER','CHARGEDUNITSOUTER',
                                'FEEGSOUTER','FEEJSGSOUTER','FEE','FEEJS','FEEDISCNTFEE','FEEADJUSTBEFORE','FEEADJUSTAFTER','FEEBILL',
                                'FEEDETAILBILL','REASONFLAG','REASONDISCNT','REMARK','IFNEEDCALC','IFCONDITION','IFERROR','UPDATETIME',
                                'CALLTIMEL','FEEJSL','CALLTIMER','FEEJSR','CHARGEDUNITS','FEEJSGS','FEELOST'
                                ,'DEALTIME','DEALFLAG','DEALTEXT','DEALTIME']
		});
	
		
	  dataStore.baseParams ={'settleUser':null};
		this.store = dataStore;
		this.sm = highFeeUserCm;
//		this.mks=new Ext.LoadMask(Ext.getBody(),{
//                                			msg:'正在努力为您加载数据，请稍候...'
//                                });
		this.bbar = new Ext.PagingToolbar({
			pageSize : 200,
			store : dataStore,
			displayInfo : true,
			displayMsg : '第 {0} - {1} 条  共 {2} 条',
			emptyMsg : "没有记录",
			listeners:{
                                beforechange:function(pt,obj) {
                                	thisGrid.recordStart = obj.start+1 ;
                                    
                                }
			}
		});
	JieSuanGridPanel.superclass.initComponent.call(this);
	},listeners : {
   		'afterrender':function(com) {
   			com.getStore().load({
                                	params:{
                                	start:0,
                                	limit:200
                                	}
			});
   		}
   	}
   	
});
//条件查询隐藏出现
QueryStatJieSuanUserForm = Ext.extend(Ext.form.FormPanel,{
	text:"表单",
	layout:"form",
	region : "center",
	labelAlign:"right",
	collapsible:true,
	collapsed:false,
	header:false,
	width:"100%",
	height:1,
	frame:true,
	layout:'table',
	layoutConfig:{
	tableAttrs: {
		align:'left'
	 },
	columns: 5
 	},
	initComponent: function(){
	var cityNameSelect = new Ext.data.JsonStore({
	    url: "highFee_getCityCode.action?type=1",//第一个comboBox的json数据的URL地址
	    root: "root",
	    fields: ["paramValue", "displayValue"]
	});
	this.items=[{ 
		    	layout : "form",
		    	xtype:'panel',
		    	colspan:1,
		    	items:[{fieldLabel : '归属地市',
							name : 'eparchyCode',
							xtype : 'combo',
							editable : false,
							mode : 'remote',
							triggerAction : 'all',
							valueField: "paramValue",
   							displayField: "displayValue",
							store : areaCodeSelect,
							emptyText:"请选择",
							width:100,
							listeners : {
		 						"select": function(combo){
									combo.ownerCt.ownerCt.getForm().findField("cityCode").reset();
									cityNameSelect.baseParams={'areaCode':combo.getValue()};
									cityNameSelect.load();
		 						}
							}
						}]},{ 
		    	layout : "form",
		    	xtype:'panel',
		    	colspan:1,
		    	items:[{fieldLabel : '归属区县',
							name : 'cityCode',
							xtype : 'combo',
							editable : false,
							mode : 'remote',
							triggerAction : 'all',
							valueField: "paramValue",
   							displayField: "displayValue",
							store : cityNameSelect,
							emptyText:"请选择",
							width:100
						}]}
                                		,{ 
		    	layout : "form",
		    	xtype:'panel',
		    	colspan:1,
		    	items:[{fieldLabel : '用户号码',
                                			name : 'msisdn',
                                			xtype : 'textfield',
                                			width:100
                                		}]}
                                		,{ 
		    	layout : "form",
		    	xtype:'panel',
		    	colspan:1,
		    	items:[{fieldLabel : '账&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;期',
                                			name : 'cycleId',
                                			xtype : 'combo',
                                			editable : false,
                                			mode : 'local',
                                			triggerAction : 'all',
                                			store : getCyids(),//  [['0','请选择'],['201303','201303'],['201304','201304'],['201305','201305']],                           			
                                			width:100,
                                			emptyText:"请选择"
                                	    }]}
                                	    ,{ 
		    	layout : "form",
		    	xtype:'panel',
		    	colspan:1,
		    	items:[{fieldLabel : '网别',
                                			name : 'netTypeCode',
                                			xtype : 'combo',
                                			editable : false,
                                			mode : 'local',
                                			emptyText:"请选择",
                                			triggerAction : 'all',
                                			store : [[null,'全部'],['10','2G用户'],['33','3G用户']],
                                			width:100
                                		}]}	  
		];
	  QueryStatJieSuanUserForm.superclass.initComponent.call(this);
	},
	buttonAlign :'center',
	minButtonWidth:60,
	buttons:[{
	text:"确定",
		handler : function(btn){
		    var thisForm = btn.ownerCt.ownerCt.getForm();
		    var cityCode = thisForm.findField('cityCode').getValue();
			var netTypeCode = thisForm.findField('netTypeCode').getValue();
			var eparchyCode  = thisForm.findField('eparchyCode').getValue();
			var cycleId = thisForm.findField('cycleId').getValue();
			var msisdn  = thisForm.findField('msisdn').getValue();
		    var store = btn.ownerCt.ownerCt.thisGrid.getStore();
		    btn.ownerCt.ownerCt.thisGrid.recordStart = 1;
		    store.baseParams = {
		    			'settleUser.cityCode':cityCode,
		    			'settleUser.eparchyCode':eparchyCode,
                        'settleUser.netTypeCode':netTypeCode,
		    			'settleUser.cycleId':cycleId,
		    			'settleUser.serialNumber':msisdn

			};

            store.load({params:{start:0, limit:200}});
		    
		   //this.ownerCt.ownerCt.ownerCt.hide();//隐藏弹出页面
		}
	}, {
		text : '重置',
		handler : function() {this.ownerCt.ownerCt.form.reset();}
	}, {
		text : '关闭',
		handler : function() {
		this.ownerCt.ownerCt.collapse(true);
			var m = this.ownerCt.ownerCt.ownerCt;
                                   	var g = m.items.get(1);
                                   	var a = m.items.get(0);
			g.setHeight(m.getHeight()-m.tbar.dom.clientHeight-1);
			this.ownerCt.ownerCt.searchBtn.setText("显示查询");
   			this.ownerCt.ownerCt.searchBtn.setIconClass("ico-dot-search-open");		}
	}]
});


